#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QPainter>
#include<QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
     this->setStyleSheet("MainWindow { border-image: url(:/map.png) 0 0 0 0 stretch stretch; }");
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::mousePressEvent(QMouseEvent *ev)
{
    a=ev->pos();
    update();
}

void MainWindow::paintEvent(QPaintEvent *e)
{
    (void)e;
    qDebug()<<a<<endl;
    QPainter painter(this);
    QPen pen(QColor(55,55,55));
    pen.setWidth(3);
    painter.setPen(pen);
    QBrush brush(Qt::cyan);
    painter.setBrush(brush);
    painter.drawEllipse(a,10,10);

}

